package com.UBC417.termproject.Servlet;

import java.io.IOException;
import java.util.logging.Logger;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.UBC417.termproject.Data.Seller;

@SuppressWarnings("serial")
public class CancelAuctionServlet extends HttpServlet {
	private static final Logger log = Logger.getLogger(SubscribeServlet.class.getName());

	public void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws IOException, ServletException {
		// Get parameters		
		String auctionId = req.getParameter("auctionId");
		
		//String forwardTo = "/?.jsp";
				
		log.info("auctionId: "+ auctionId);
		
		Seller.CancelAuction(auctionId);
		
        // redirect to user page
        String forwardTo = "/seller.jsp";
		ServletContext sc = getServletContext();
		RequestDispatcher rd = sc.getRequestDispatcher(forwardTo);
		rd.forward(req, resp);
		
	}	

}
